#include <stdio.h>
#include <string.h>

int main(int argc, char* argv[])
{
    if (argc != 2)
    {
        printf("Usage: %s 至少要有一个选项\n", argv[0]);
        return 1;
    }
    if (strcmp("-a", argv[1]) == 0)
    {
        printf("这个是功能一\n");
    }
    else if (strcmp("-b", argv[1]) == 0)
    {
        printf("这个是功能二\n");
    }
    return 0;
}

//#include <sys/types.h>
//#include <stdlib.h>

    //int i = 0;
    //for (i = 0; i < argc; ++i)
    //{
    //    printf("argv[%d]: %s\n", i, argv[i]);
    //}
    
    //printf("begin.....................\n");
    //printf("%s\n", getenv("class11"));
    //printf("end.......................\n");

    //printf("%s\n", getenv("PATH"));
    
    //extern char** environ;  // 声明环境变量
    //int i = 0;
    //for (i = 0; environ[i]; ++i)
    //{
    //    printf("environ[%d]: %s\n", i, environ[i]);
    //}
    
    //int i = 0;
    //for (i = 0; env[i]; ++i)
    //{
    //    printf("env[%d]: %s\n", i, env[i]);
    //}
